<?php
	function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    $Loi = false;
    
    $MaLoaiSanPhamCap1 = $_POST['MaLoaiSanPhamCap1'];
	$TenLoaiSanPhamCap1 = $_POST['TenLoaiSanPhamCap1'];
    $MaLoaiSanPham = $_POST['MaLoaiSanPham'];
		    
    $loaisanphamc1 = new loaisanphamc1bs();
    $loaisanphamc1->MaLoaiSanPhamCap1 = $MaLoaiSanPhamCap1;
    $loaisanphamc1->TenLoaiSanPhamCap1 = $TenLoaiSanPhamCap1;
    $loaisanphamc1->MaLoaiSanPham = $MaLoaiSanPham;
    $isset = $loaisanphamc1->issetTypes();
    
    if($isset[0]['SoDong'] != 1)
        $Loi = true;
    
    if($Loi == false)
    {
        if($loaisanphamc1->update())
            echo "yes";
        else
            echo "no";
    }
    else
    {
        echo "no";
    }
?>